<script setup lang="ts">

import HelloWorld from "@/components/HelloWorld.vue";
import {getCurrentInstance, h, onMounted, useAttrs, useSlots} from "vue";

onMounted(() => {
  console.log(getCurrentInstance())
})

// const Temp = h(HelloWorld, useAttrs(), useSlots())
</script>

<template>
<div>
  <h1>Child 组件</h1>
<!--  <HelloWorld v-bind="$attrs">
    <template v-for="(_, slot) in $slots" v-slot:[slot]="slotProps"
    :key="slot">
      <slot :name="slot" v-bind="slotProps"></slot>
    </template>
  </HelloWorld>-->
<!--  <Temp></Temp>-->
<!--  <component :is="h(HelloWorld, useAttrs(), useSlots())"></component>-->
  <component :is="h(HelloWorld, $attrs, $slots)"></component>
</div>
</template>

<style scoped>

</style>